﻿using EventBus.RabbitMQ.Events;
using System;
using System.Collections.Generic;
using System.Threading;

namespace EventBus.RabbitMQ
{
    public interface IConsumerClient : IDisposable
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="routeInfos"></param>
        void Subscribe(List<RouteInfo> routeInfos);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="timeout"></param>
        /// <param name="cancellationToken"></param>
        void Listening(TimeSpan timeout, CancellationToken cancellationToken);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        void Commit(object sender);

        /// <summary>
        /// Reject message and resumption
        /// </summary>
        void Reject(object sender);

        event EventHandler<QueueMessage> OnMessageReceived;
    }
}